package com.kandinfo.base.common.util.redis;

import net.sf.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by liminghua on 15/12/29.
 */
public class RedisLogger {
    private static final Logger LOGGER = LoggerFactory.getLogger(RedisLogger.class);

    public static void log(String type, String version, Object... args){
        if(isLogEnabled()) {
            LOGGER.info(type + "|" + version + "|{}", JSONArray.fromObject(args).toString());
        }
    }

    public static boolean isLogEnabled(){
        return LOGGER.isInfoEnabled();
    }
}
